<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html;charset=utf-8"%>
<%@page isELIgnored="false" %>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<style type="text/css">
ul li {
	text-decoration: none;
	list-style-type: none;
	line-height: 20px;
}

body {
	font-family: 宋体, Arial, Helvetica, sans-serif;
	font-size: 12px;
	background: #769b72 url(${pageContext.request.contextPath}/images/booksaleimg/bg_grad.gif) top center
		no-repeat;
	cursor: default;
	color: #404040;
	margin: 0;
	padding: 0;
}
</style>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.11.1.js"></script>
	<script type="text/javascript">
        $(function () {
            $("img[name='img2']").click(function () {
                var id=$(this).next().html()
                //$(this).prop("src","${pageContext.request.contextPath}/cart/cart_addCart?bookid="+id)
				$.ajax({
					url:"${pageContext.request.contextPath}/addCart.do",
					data:"bookid="+id,
                    success:function(result){
                        if(result=='loseToken'){
                            //跳转到登录页面
                            window.location="${pageContext.request.contextPath}/user/login_form.jsp"
                        }
                    }
				})
                var that=$(this);
                window.setTimeout(function () {
                    that.prop("src","${pageContext.request.contextPath}/images/load.gif")
                },500)
                window.setTimeout(function () {
                    that.prop("src","${pageContext.request.contextPath}/images/label3.gif")
                },1000)
                window.setTimeout(function () {
                    that.prop("src","${pageContext.request.contextPath}/images/buttom_goumai.gif")
                },1500)
            })
        })
	</script>
</head>
<body>
	<div style="width: 60%;margin:20px auto;">
		<div style="width:100%;float: left;">
			<h1>
				
			</h1>
			<span><font color="#cccccc">丛书名：${book.book_name}</font></span>
			<hr />
			<div>
				<div style="float: left;width:20%;">
					<img src="${pageContext.request.contextPath}/productImages/${book.product_image}"  border=0 />
				</div>
				<div style="float: left;width:80%">
					<ul class="info">
						<li>作&nbsp;者：${book.author}</li>
						<li>出版社：${book.press}</li>
						<li style="float:left;width:50%;">出版时间：<fmt:formatDate value="${book.groundingDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate> </li>
						<li style="float:left;width:50%;">字数：${book.word_count}</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">版次：${book.editNum}</li>
						<li style="float:left;width:50%;">页数：${book.page_count}</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">印刷时间：<fmt:formatDate value="${book.print_date}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate> </li>
						<li style="float:left;width:50%;">开本：	${book.style}</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">印次：${book.print_count}</li>
						<li style="float:left;width:50%;">纸张：${book.page}</li>
						<li style="float:clear;"></li>
						<li style="float:left;width:50%;">ISBN：${book.ISBN}</li>
						<li style="float:left;width:50%;">包装：${book.pack}</li>
						<li>
							<div class='your_position'>
								您现在的位置:&nbsp; <a href='${pageContext.request.contextPath}/main.do'>当当图书</a> &gt;&gt;
								<font style='color: #cc3300'> 
									<strong>${category.category_name}
									</strong>
								</font>
							</div>
						</li>
						<li>定价：￥${book.book_price}
							当当价：￥${book.dangPrice} 节省：￥${book.book_price-book.dangPrice}</li>
						<li><a href="javascript:void(0)"> <img
								name="img2" src='${pageContext.request.contextPath}/images/buttom_goumai.gif' class="abc"/><span style="display: none;">${book.book_id}</span>
						</a></li>
					</ul>
				</div>
				<div style="float: clear;"></div>
			</div>
		</div>

		<div style="width:100%;float: left;">
			<hr width="" size="1">
				<div>
					<h2>编辑推荐</h2>
					${book.recommend}
				</div>
			</hr>
			<hr width="" size="1">
				<div>
					<h2>内容简介</h2>
					${book.messages}
				</div>
			</hr>
			<hr width="" size="1">
				<div>
					<h2>作者简介</h2>
					${book.author_msg}
				</div>
			</hr>

				<table>

					<c:forEach items="${commentList}" var="com">
					<tr>
						<td>用户名:</td><td>${com.user.user_nickname}</td>
						<td>评论:</td><td>${com.content}</td>
					</tr>
					<c:forEach items="${com.commentList}" var="co">
						<tr>
							<td>&nbsp;&nbsp;</td><td>用户名:</td><td>${co.user.user_nickname}</td>
							<td>评论:</td><td>${co.content}</td>
						</tr>
						<c:forEach items="${co.commentList}" var="c">
							<tr>
								<td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td>用户名:</td><td>${c.user.user_nickname}</td>
								<td>评论:</td><td>${c.content}</td>
							</tr>
						</c:forEach>
					</c:forEach>
					</c:forEach>
				</table>

			<div>
				<div style="float: clear"></div>
				<p>&nbsp;</p>
			</div>
		</div>
	</div>
	<!--页尾开始 -->
	<%@include file="../common/foot.jsp"%>
	<!--页尾结束 -->
</body>
</html>